#!/bin/bash
li="\n";
for f in $(ls -d src/*)
do
    n=$(echo ${f} |cut -d'/' -f2 )
    toml='\n[book]\nsrc = "'$f'"\n[build]\nbuild-dir = "book/'$n'"'
    echo -e ${toml} > book.toml
    $(mdbook build)
    li="${li}<li><a href='"$n"'>$n</a></li>\n"
done
echo -e "<ul>${li}</ul>" > book/index.html
